<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/WEB-INF/templates/cadProfis.xhtml">
    <ui:param name="pPageTitle" value="Passo 5 de 5 | Desejos" />
    <ui:define name="formulario">
        <p:toolbar>
            <p:toolbarGroup align="left">
                <p:commandButton action="#{desejosView.voltar}" ajax="false"
                                 value="Voltar" icon="ui-icon-arrowthick-1-w" />
            </p:toolbarGroup>
            <p:toolbarGroup align="right">
                <p:commandButton action="#{desejosView.actionSalvar}" ajax="false" 
                                 actionListener="#{profissionalView.closeConversation(event)}"
                                 value="Finalizar" icon="ui-icon-check" />
            </p:toolbarGroup>
        </p:toolbar>
        <p:spacer width="10px"/>

        <h:panelGrid columns="3" cellpadding="2" columnClasses="textAlignRight,,textAlignLeft">
            <h:outputText value="${label['perg.1']}" />
            <p:selectBooleanButton value="#{desejosView.perg1}" onLabel="Não" offLabel="Sim" onIcon="ui-icon-close" offIcon="ui-icon-check">  
                <p:ajax event="change" update="perg1" listener="#{desejosView.acaoBtP1}"/>  
            </p:selectBooleanButton>
            <p:inputText id="perg1" value="#{desejosView.desejo.trabFunc}" label="${label['perg.1']}" required="true" size="60" 
                         maxlength="99" style="text-transform: capitalize" disabled="#{desejosView.perg1}"/>

            <h:outputText value="${label['perg.2']}"/>
            <p:selectBooleanButton value="#{desejosView.perg2}" onLabel="Sim" offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close">
                <p:ajax event="change" update="perg2,p1,p2,p3,p4," listener="#{desejosView.acaoBtP2}"/>  
            </p:selectBooleanButton>
            
            <p:panel id="perg2" header="Informe para cada dia da semana o horario disponivel" visible="#{desejosView.perg2}">

                <h:panelGrid columns="7" columnClasses="textAlignCenter,textAlignCenter,textAlignCenter,textAlignCenter,textAlignCenter,textAlignCenter,textAlignCenter">
                    <p:outputLabel value="Dom"/>
                    <p:outputLabel value="Seg"/>
                    <p:outputLabel value="Ter"/>
                    <p:outputLabel value="Qua"/>
                    <p:outputLabel value="Qui"/>
                    <p:outputLabel value="Sex"/>
                    <p:outputLabel value="Sab"/>

                    <p:inputMask id="p1" value="#{desejosView.desejo.dom}" mask="99:00 às 99:00" size="10"/>
                    <p:inputMask id="p2" value="#{desejosView.desejo.seg}" mask="99:00 às 99:00" size="10"/>
                    <p:inputMask id="p3" value="#{desejosView.desejo.ter}" mask="99:00 às 99:00" size="10"/>
                    <p:inputMask id="p4" value="#{desejosView.desejo.qua}" mask="99:00 às 99:00" size="10"/>
                    <p:inputMask id="p5" value="#{desejosView.desejo.qui}" mask="99:00 às 99:00" size="10"/>
                    <p:inputMask id="p6" value="#{desejosView.desejo.sex}" mask="99:00 às 99:00" size="10"/>
                    <p:inputMask id="p7" value="#{desejosView.desejo.sab}" mask="99:00 às 99:00" size="10"/>
                </h:panelGrid>
            </p:panel>

            <h:outputText value="Função especifica?" />
            <p:selectBooleanButton value="#{desejosView.perg3}" onLabel="Não" offLabel="Sim" onIcon="ui-icon-close" offIcon="ui-icon-check">  
                <p:ajax event="change" update="perg3" listener="#{desejosView.acaoBtP3}"/>  
            </p:selectBooleanButton>
            <p:inputText id="perg3" value="#{desejosView.desejo.funcaoP}" label="${label['perg.3']}" required="true" size="60" 
                         maxlength="99" style="text-transform: capitalize" disabled="#{desejosView.perg3}"/>

            <h:outputText value="${label['perg.5']}" />
            <p:selectBooleanButton value="#{desejosView.perg4}" onLabel="Não" offLabel="Sim" onIcon="ui-icon-close" offIcon="ui-icon-check">  
                <p:ajax event="change" update="perg4" listener="#{desejosView.acaoBtP4}"/>  
            </p:selectBooleanButton>
            <p:inputText id="perg4" value="#{desejosView.desejo.formDife}" label="${label['perg.5']}" required="true" size="60" 
                         maxlength="99" style="text-transform: capitalize" disabled="#{desejosView.perg4}"/>
        </h:panelGrid> 
        <h:outputText value="Os campos com ( * ) são de preenchimento obrigatório" style="color: red"/>
    </ui:define>
</ui:composition>